package com.emip.service.impl;

import java.util.Date;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.emip.bean.ItemBean;
import com.emip.bean.RealDataBean;
import com.emip.bean.SiteBean;
import com.emip.dao.RealDataDAO;
import com.emip.service.RealDataService;

@Service("realDataService")
public class RealDataServiceImpl implements RealDataService {

	@Autowired
	RealDataDAO realDataDAO;
	
	public String getCurrentValue(SiteBean site, ItemBean item) {
		RealDataBean bean = realDataDAO.findBySiteItem(site, item);
		return bean.getValue();
	}

	public String getFalg(SiteBean site, ItemBean item) {
		RealDataBean bean = realDataDAO.findBySiteItem(site, item);
		return bean.getFlag();
	}

	public Date getGenTime(SiteBean site, ItemBean item) {
		RealDataBean bean = realDataDAO.findBySiteItem(site, item);
		return bean.getGenTime();
	}

	public RealDataBean getRealDataBySiteItem(SiteBean site, ItemBean item) {
		return realDataDAO.findBySiteItem(site, item);
	}

}
